import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
  // {
  //   title: '单据类型',
  //   align: "center",
  //   dataIndex: 'billTypeName'
  // },
  {
    title: '计划编号',
    align: "center",
    dataIndex: 'billCode'
  },
  {
    title: '计划名称',
    align: "center",
    dataIndex: 'planName'
  },
  {
    title: '版本号',
    align: "center",
    dataIndex: 'planVersion'
  },
  {
    title: '计划方法',
    align: "center",
    dataIndex: 'planMethod_dictText',
    customRender: ({
      text
    }) => render.renderDict(text, 'marbas_plan_method')
  },
  {
    title: '主生产计划号',
    align: "center",
    dataIndex: 'masterPlanCode'
  },
  {
    title: '开始日期',
    align: "center",
    dataIndex: 'startDate',
    customRender: ({
      text
    }) => {
      return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
    },
  },
  {
    title: '结束日期',
    align: "center",
    dataIndex: 'endDate',
    customRender: ({
      text
    }) => {
      return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
    },
  },
  {
    title: '计划时间',
    align: "center",
    dataIndex: 'planTime'
  },
  {
    title: '料品分类名称',
    align: "center",
    dataIndex: 'marbasclassName'
  },
  {
    title: '计划员名称',
    align: "center",
    dataIndex: 'plannerName'
  },
  {
    title: '计划组织名称',
    align: "center",
    dataIndex: 'planOrganizationName'
  },
  {
    title: '时格合并类型',
    align: "center",
    dataIndex: 'timeIntervalMergeType_dictText',
    customRender: ({
      text
    }) => {
      return render.renderDict(text, 'plan_organization_name');
    },
  },
  {
    title: '时格名称',
    align: "center",
    dataIndex: 'timeIntervalName'
  },
  {
    title: '时格天数',
    align: "center",
    dataIndex: 'timeIntervalDay'
  },
  {
    title: '料品控制',
    align: "center",
    dataIndex: 'materialControl',
    customRender: ({
      text
    }) => {
      return render.renderDict(text, 'material_control');
    }
  },
  {
    title: '排产方案名称',
    align: "center",
    dataIndex: 'productPlanName'
  }, {
    title: '替代优化策略',
    align: "center",
    dataIndex: 'replaceOptimizeStrategy_dictText',
    customRender: ({
      text
    }) => {
      return render.renderDict(text, 'replace_optimize_strategy_dictText');
    }
  },
  {
    title: '优化目标',
    align: "center",
    dataIndex: 'optimizeTarget'
  },
  {
    title: '优化范围',
    align: "center",
    dataIndex: 'optimizeRange'
  },
  {
    title: '过去天数',
    align: "center",
    dataIndex: 'pastDay'
  },
  // {
  //   title: '单据状态',
  //   align: "center",
  //   dataIndex: 'billStatus',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'plan_order_bill_status');
  //   }
  // },
  {
    title: '备注',
    align: "center",
    dataIndex: 'remark'
  },
  // {
  //   title: '从需求分类',
  //   align: "center",
  //   dataIndex: 'followDemandClassification_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '到需求分类',
  //   align: "center",
  //   dataIndex: 'arriveDemandClassification_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '按排产方案执行',
  //   align: "center",
  //   dataIndex: 'planExecute_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '发放追踪',
  //   align: "center",
  //   dataIndex: 'grantTrack_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '自动发放',
  //   align: "center",
  //   dataIndex: 'autoGrant_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '自动转MPS',
  //   align: "center",
  //   dataIndex: 'autoToMps_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '处理过期供需',
  //   align: "center",
  //   dataIndex: 'handleExpiredDemand_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: 'MPS',
  //   align: "center",
  //   dataIndex: 'mps_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '采购合同',
  //   align: "center",
  //   dataIndex: 'procurementContract_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '生产订单',
  //   align: "center",
  //   dataIndex: 'productOrder_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '已入未检数量',
  //   align: "center",
  //   dataIndex: 'uncheckQuantity_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '采购订单',
  //   align: "center",
  //   dataIndex: 'purchaseOrder_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '渠道库存',
  //   align: "center",
  //   dataIndex: 'channelInventory_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '生产线日计划',
  //   align: "center",
  //   dataIndex: 'productLineDayPlan_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '现存量',
  //   align: "center",
  //   dataIndex: 'stockQuantity_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '请购单',
  //   align: "center",
  //   dataIndex: 'buyingRequisition_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '锁定的计划订单',
  //   align: "center",
  //   dataIndex: 'lockPlannedOrder_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '库存在途',
  //   align: "center",
  //   dataIndex: 'inventoryTransit_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '委外请购',
  //   align: "center",
  //   dataIndex: 'outsourcingRequisition_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '销售订单',
  //   align: "center",
  //   dataIndex: 'saleOrder_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '报价单',
  //   align: "center",
  //   dataIndex: 'quotationOrder_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '考虑负库存',
  //   align: "center",
  //   dataIndex: 'considerNegativeInventory_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '销售合同',
  //   align: "center",
  //   dataIndex: 'saleContract_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '生产计划',
  //   align: "center",
  //   dataIndex: 'productPlan_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '在制备料需求',
  //   align: "center",
  //   dataIndex: 'preparationMaterialRequisition_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '销售预测',
  //   align: "center",
  //   dataIndex: 'saleForecast_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '计划订单',
  //   align: "center",
  //   dataIndex: 'planOrder_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '委外备料需求',
  //   align: "center",
  //   dataIndex: 'outsourcingMaterialRequisition_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '预测订单',
  //   align: "center",
  //   dataIndex: 'forecastOrder_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '主需求计划',
  //   align: "center",
  //   dataIndex: 'masterDemandPlan_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '料品需求单',
  //   align: "center",
  //   dataIndex: 'materialRequirementOrder_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '安全库存',
  //   align: "center",
  //   dataIndex: 'safetyStock_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: 'WBS',
  //   align: "center",
  //   dataIndex: 'wbs_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '替代优化',
  //   align: "center",
  //   dataIndex: 'replaceOptimize_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },

  // {
  //   title: '同步备料',
  //   align: "center",
  //   dataIndex: 'syncMaterial_dictText',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
  // {
  //   title: '打印优化日志',
  //   align: "center",
  //   dataIndex: 'printOptimizationLog',
  //   customRender: ({
  //     text
  //   }) => {
  //     return render.renderDict(text, 'yn');
  //   }
  // },
];
//查询数据
export const searchFormSchema: FormSchema[] = [{
  label: "订单编号",
  field: "orderBillCode",
  component: 'Input',
}, {
  label: "料品编号",
  field: "materialCode",
  component: 'Input',
  colProps: {
    span: 6
  },
},{
    label: "计划编号",
    field: "srcBillCode",
    component: 'Input',
  },
  {
    label: "计划日期",
    field: "planTime",
    component: 'RangePicker',
    componentProps: {
      valueType: 'Date'
    },
  },
  {
    label: '计划员',
    field: 'planner',
    component: 'Input',
    componentProps: {
      isRadioSelection: true,
      rowKey: 'id',
      labelKey: 'realname',
      showButton: false
    },
  },
  {
    label: "是否释放",
    field: 'releaseStatus',
    component: 'JDictSelectTag',
    componentProps: {
      showChooseOption: false,
      stringToNumber: true,
      options: [{
          label: '未释放',
          value: 0
        },
        {
          label: '已释放',
          value: 1
        },
      ],
    },
    colProps: {
      span: 6
    },
  },
  {
    label: "供应方式",
    field: 'supplyType',
    component: 'JDictSelectTag',
    componentProps: {
      showChooseOption: false,
      stringToNumber: true,
      options: [{
          label: '自制',
          value: 0
        },
        {
          label: '采购',
          value: 1
        },
        {
          label: '委外',
          value: 2
        },
      ],
    },
  },
  {
    label: "是否锁定",
    field: 'lockStatus',
    component: 'JDictSelectTag',
    componentProps: {
      showChooseOption: false,
      stringToNumber: true,
      options: [{
          label: '未锁定',
          value: 0
        },
        {
          label: '已锁定',
          value: 1
        },
      ],
    },
  },
  {
    label: "需求类型",
    field: 'demandType',
    component: 'JDictSelectTag',
    componentProps: {
      showChooseOption: false,
      stringToNumber: true,
      options: [{
          label: '独立',
          value: 0
        },
        {
          label: '相关',
          value: 1
        },
      ],
    },
  },
  {
    label: "是否排产",
    field: 'productScheduleStatus',
    component: 'JDictSelectTag',
    componentProps: {
      showChooseOption: false,
      stringToNumber: true,
      options: [{
          label: '未排产',
          value: 0
        },
        {
          label: '已排产',
          value: 1
        },
      ],
    },
  },
  {
    label: " ",
    field: 'ignoreLtZero',
    component: 'JCheckbox',
    componentProps: {
      options: [
      {
        label:"过滤需求量为零的计划行",
        value:"1"
      }
     ]
    },
  },
  {
    label: "排产单号",
    field: 'PlanDocNo',
    component: 'JInput',
  },
];
//表单数据
export const formSchema: FormSchema[] = [{
    label: '计划编号',
    field: 'billCode',
    component: 'Input',
  },
  {
    label: '计划名称',
    field: 'planName',
    component: 'Input',
  },
  {
    label: '版本号',
    field: 'planVersion',
    component: 'Input',
  },

  {
    label: '料品分类名称',
    field: 'marbasclassName',
    component: 'Input',
  },

  {
    label: '计划组织名称',
    field: 'planOrganizationName',
    component: 'Input',
  },
  {
    label: '排产方案名称',
    field: 'productPlanName',
    component: 'Input',
  },
  // {
  //   label: '单据状态',
  //   field: 'billStatus',
  //   component: 'JDictSelectTag',
  //   componentProps: {
  //     dictCode: "plan_order_bill_status",
  //     stringToNumber: true,
  //   },
  // },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '第三方编码',
    field: 'thirdPartyCode',
    component: 'Input',
    ifShow: false
  },
  {
    label: '按排产方案执行',
    field: 'planExecute',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
];
// 基本信息表单数据
export const basicinformationFormSchema: FormSchema[] = [{
    label: '计划方法',
    field: 'planMethod',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "marbas_plan_method",
      stringToNumber: true,
    },
  }, {
    label: '主生产计划号',
    field: 'masterPlanCode',
    component: 'Input',
    slot: 'masterPlanSlot'
  },
  {
    label: '开始日期',
    field: 'startDate',
    component: 'DatePicker',
  },
  {
    label: '结束日期',
    field: 'endDate',
    component: 'DatePicker',
  },
  {
    label: '计划时间',
    field: 'planTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  }, {
    label: '说明',
    field: 'description',
    component: 'Input',
  }
]
// 计划参数表单数据
export const planParameterFormSchema: FormSchema[] = [{
    label: '时格合并类型',
    field: 'timeIntervalMergeType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "plan_organization_name",
      stringToNumber: true,
    },
  },
  {
    label: '时格名称',
    field: 'timeIntervalName',
    component: 'Input',
  },
  {
    label: '时格天数',
    field: 'timeIntervalDay',
    component: 'InputNumber',
  }, {
    label: '计划员名称',
    field: 'plannerName',
    component: 'Input',
  },
  {
    label: '料品控制',
    field: 'materialControl',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "material_control",
      stringToNumber: true,
    },
  },
  {
    label: '从需求分类',
    field: 'followDemandClassification',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '到需求分类',
    field: 'arriveDemandClassification',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  }, {
    label: '发放追踪',
    field: 'grantTrack',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '自动发放',
    field: 'autoGrant',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '自动转MPS',
    field: 'autoToMps',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '处理过期供需',
    field: 'handleExpiredDemand',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '按需求分类执行',
    field: 'demandExecute',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
];
// 供需 表单数据
export const supplyDemandFormSchema: FormSchema[] = [
  // 供应
  {
    label: 'MPS',
    field: 'mps',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '采购合同',
    field: 'procurementContract',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '生产订单',
    field: 'productOrder',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '已入未检数量',
    field: 'uncheckQuantity',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '采购订单',
    field: 'purchaseOrder',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '渠道库存',
    field: 'channelInventory',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '生产线日计划',
    field: 'productLineDayPlan',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '现存量',
    field: 'stockQuantity',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '请购单',
    field: 'buyingRequisition',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '锁定的计划订单',
    field: 'lockPlannedOrder',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '库存在途',
    field: 'inventoryTransit',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '委外请购',
    field: 'outsourcingRequisition',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  // 需求
  {
    label: '销售订单',
    field: 'saleOrder',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '报价单',
    field: 'quotationOrder',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '考虑负库存',
    field: 'considerNegativeInventory',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '销售合同',
    field: 'saleContract',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },

  {
    label: '在制备料需求',
    field: 'preparationMaterialRequisition',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '销售预测',
    field: 'saleForecast',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '计划订单',
    field: 'planOrder',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '委外备料需求',
    field: 'outsourcingMaterialRequisition',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '预测订单',
    field: 'forecastOrder',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '主需求计划',
    field: 'masterDemandPlan',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '料品需求单',
    field: 'materialRequirementOrder',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '安全库存',
    field: 'safetyStock',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: 'WBS',
    field: 'wbs',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  }, {
    label: '生产计划',
    field: 'productPlan',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
];
// 优化 表单数据
export const optimizeFormSchema: FormSchema[] = [{
    label: '替代优化',
    field: 'replaceOptimize',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  }, {
    label: '替代优化策略',
    field: 'replaceOptimizeStrategy',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "replace_optimize_strategy_dictText",
      stringToNumber: true,
    },
  }, {
    label: '优化目标',
    field: 'optimizeTarget',
    component: 'Input',
  },
  {
    label: '优化范围',
    field: 'optimizeRange',
    component: 'Input',
  },
  {
    label: '过去天数',
    field: 'pastDay',
    component: 'InputNumber',
  }, {
    label: '同步备料',
    field: 'syncMaterial',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
  {
    label: '打印优化日志',
    field: 'printOptimizationLog',
    defaultValue: 0,
    component: 'JSwitch',
    componentProps: {
      options: [1, 0]
    },
  },
];
//子表单数据
//子表表格配置
export const psPlanOrderVersionColumns: JVxeColumn[] = [{
    title: '计划订单ID',
    key: 'planOrderId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '行号',
    key: 'rowNum',
    type: JVxeTypes.inputNumber,
    width: "80px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '版本号',
    key: 'planVersion',
    type: JVxeTypes.input,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '主版本',
    key: 'masterVersion',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '映射数据库', // 0否 1是
    key: 'mappingDatabase',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '需求时界原则',
    key: 'demandTimeFencePrinciple',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '需求时界日期',
    key: 'demandTimeFenceDate',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '计划时界原则',
    key: 'planTimeFencePrinciple',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '计划时界日期',
    key: 'planTimeFenceDate',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '计划时界控制',
    key: 'planTimeFenceControl',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '发放时界日期',
    key: 'grantTimeFenceDate',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '计划生产订单时界日期',
    key: 'planOrderTimeFenceDate',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '计划订单截止日期',
    key: 'planOrderEndDate',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '净改变',
    key: 'netChange',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '重新计算低阶码',
    key: 'recalculateLowOrderCode',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '备注',
    key: 'remark',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '删除状态', //0正常 1已删除
    key: 'delFlag',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '创建方式', //0系统生成
    key: 'createMethod',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '第三方编码',
    key: 'thirdPartyCode',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '组织ID',
    key: 'organizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '租户ID',
    key: 'tenantId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
]
export const psPlanOrderItemColumns: JVxeColumn[] = [{
    title: '计划订单ID',
    key: 'planOrderId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '行号',
    key: 'rowNum',
    type: JVxeTypes.inputNumber,
    width: "80px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  // {
  //   title: '单据类型ID',
  //   key: 'billTypeId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '单据类型',
  //   key: 'billTypeName',
  //   type: JVxeTypes.input,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  {
    title: '订单渠道', //0直销渠道 1分销渠道
    key: 'orderChannel',
    type: JVxeTypes.select,
    width: "150px",
    options: [{
      label: '国内订单',
      value: 0
    }, {
      label: '海外订单',
      value: 1
    }, {
      label: '研发订单',
      value: 2
    }, {
      label: '售后订单',
      value: 3
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '单据编号',
    key: 'billCode',
    type: JVxeTypes.input,
    width: "150px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '料品ID',
    key: 'materialId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '料品编号',
    key: 'materialCode',
    type: JVxeTypes.normal,
    width: "150px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '料品名称',
    key: 'materialName',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '料品规格',
    key: 'spec',
    type: JVxeTypes.input,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '单位ID',
    key: 'unitId',
    type: JVxeTypes.hidden,
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '单位名称',
    key: 'unitName',
    width: "100px",
    type: JVxeTypes.normal,
    disabled: true
  },
  {
    title: '订单数量',
    key: 'orderQuantity',
    type: JVxeTypes.inputNumber,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '已交数量',
    key: 'deliveryQuantity',
    type: JVxeTypes.inputNumber,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '订单交期',
    key: 'orderDeliveryDate',
    type: JVxeTypes.date,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '和云销售订单号',
    key: 'hjSerialNumber',
    type: JVxeTypes.input,
    width: "150px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '评审单号',
    key: 'reviewCode',
    type: JVxeTypes.input,
    width: "150px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '业务员ID',
    key: 'salesmanId',
    type: JVxeTypes.hidden,
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '业务员名称',
    key: 'salesmanName',
    type: JVxeTypes.input,
    width: "150px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '客户ID',
    key: 'customerId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '客户编码',
    key: 'customerCode',
    type: JVxeTypes.input,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '客户名称',
    key: 'customerName',
    type: JVxeTypes.input,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '接单组织ID',
    key: 'orderOrganizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '接单组织名称',
    key: 'orderOrganizationName',
    type: JVxeTypes.input,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '生产组织ID',
    key: 'produceOrganizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '生产组织名称',
    key: 'produceOrganizationName',
    type: JVxeTypes.hidden,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: 'BOM是否完整', //0否 1是
    key: 'bomComplete',
    type: JVxeTypes.select,
    width: "100px",
    options: [{
      value: 0,
      label: '否'
    }, {
      value: 1,
      label: '是'
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '非完整BOM是否安排生产', //0否 1是
    key: 'notCompleteProduce',
    type: JVxeTypes.select,
    width: "100px",
    options: [{
      value: 0,
      label: '否'
    }, {
      value: 1,
      label: '是'
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '异步状态', //0只读 1可写
    key: 'syncStatus',
    type: JVxeTypes.select,
    width: "100px",
    options: [{
      value: 0,
      label: '只读'
    }, {
      value: 1,
      label: '可写'
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  // {
  //   title: '来源单据ID',
  //   key: 'srcBillId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '来源单据编号',
  //   key: 'srcBillCode',
  //   type: JVxeTypes.input,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '来源单据类型ID',
  //   key: 'srcBillTypeId',
  //   type: JVxeTypes.hidden,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '来源单据类型名称',
  //   key: 'srcBillTypeName',
  //   type: JVxeTypes.input,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '来源单据明细ID',
  //   key: 'srcBillItemId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  {
    title: '来源行号',
    key: 'orderRowNumber',
    type: JVxeTypes.normal,
    width: "100px",
    defaultValue: '',
  },
  // {
  //   title: '源头单据ID',
  //   key: 'firstBillId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  {
    title: '来源订单号',
    key: 'firstBillCode',
    type: JVxeTypes.normal,
    width: "100px",
  },
  // {
  //   title: '源头单据类型ID',
  //   key: 'firstBillTypeId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '源头单据类型名称',
  //   key: 'firstBillTypeName',
  //   type: JVxeTypes.input,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  {
    title: '备注',
    key: 'remark',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '删除状态', //0正常 1已删除
    key: 'delFlag',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '创建方式', //0系统生成
    key: 'createMethod',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '第三方编码',
    key: 'thirdPartyCode',
    type: JVxeTypes.hidden,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '组织ID',
    key: 'organizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '租户ID',
    key: 'tenantId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
]
export const psPlanOrderResultColumns: JVxeColumn[] = [{
    title: '计划订单ID',
    key: 'planOrderId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '行号',
    key: 'rowNum',
    type: JVxeTypes.normal,
    width: "80px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '生产组织ID',
    key: 'productOrganizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '生产组织名称',
    key: 'productOrganizationName',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '版本号',
    key: 'resultVersion',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '料品ID',
    key: 'materialId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '料品编号',
    key: 'materialCode',
    type: JVxeTypes.normal,
    width: "150px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '料品名称',
    key: 'materialName',
    type: JVxeTypes.normal,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '料品规格',
    key: 'spec',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '单位ID',
    key: 'unitId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '单位名称',
    key: 'unitName',
    width: "100px",
    type: JVxeTypes.normal,
    disabled: true,
  },
  {
    title: '供应类型', // 0自制 1采购 2委外
    key: 'supplyType',
    type: JVxeTypes.normal,
    width: "100px",
    options: [{
      value: 0,
      label: '自制'
    }, {
      value: 1,
      label: '采购'
    }, {
      value: 2,
      label: '委外'
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '供应商ID',
    key: 'supplierId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '供应商名称',
    key: 'supplierName',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '订单数量',
    key: 'orderQuantity',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: 'MRP数量',
    key: 'mrpQuantity',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '调整后MRP数量',
    key: 'adjustedMrpQuantity',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '释放量',
    key: 'releaseQuantity',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '需求日期',
    key: 'demandDate',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '开工日期',
    key: 'startDate',
    type: JVxeTypes.normal,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '需求类型', // 0独立 1相关
    key: 'demandType',
    type: JVxeTypes.normal,
    width: "100px",
    options: [{
      value: 0,
      label: '独立'
    }, {
      value: 1,
      label: '相关'
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '释放状态', //0未释放 1已释放
    key: 'releaseStatus',
    type: JVxeTypes.normal,
    width: "100px",
    options: [{
      value: 0,
      label: '未释放'
    }, {
      value: 1,
      label: '已释放'
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '是否排产', // 0否 1是
    key: 'productScheduleStatus',
    type: JVxeTypes.normal,
    width: "100px",
    options: [{
      value: 0,
      label: '否'
    }, {
      value: 1,
      label: '是'
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '锁定状态', // 0未锁定 1已锁定
    key: 'lockStatus',
    type: JVxeTypes.normal,
    width: "100px",
    options: [{
      value: 0,
      label: '未锁定'
    }, {
      value: 1,
      label: '已锁定'
    }],
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  // {
  //   title: '来源单据ID',
  //   key: 'srcBillId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  //   disabled: true
  // },
  // {
  //   title: '来源单据编号',
  //   key: 'srcBillCode',
  //   type: JVxeTypes.input,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  //   disabled: true
  // },
  // {
  //   title: '来源单据类型ID',
  //   key: 'srcBillTypeId',
  //   type: JVxeTypes.hidden,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  //   disabled: true
  // },
  // {
  //   title: '来源单据类型名称',
  //   key: 'srcBillTypeName',
  //   type: JVxeTypes.input,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  //   disabled: true
  // },
  // {
  //   title: '来源单据明细ID',
  //   key: 'srcBillItemId',
  //   type: JVxeTypes.hidden,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  //   disabled: true
  // },
  {
    title: '来源行号',
    key: 'orderRowNumber',
    type: JVxeTypes.normal,
    width: "100px",
    defaultValue: '',
  },
  // {
  //   title: '源头单据ID',
  //   key: 'firstBillId',
  //   type: JVxeTypes.hidden,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  //   disabled: true
  // },
  {
    title: '来源订单号',
    key: 'orderBillCode',
    type: JVxeTypes.normal,
    width: "140px",
  },
  // {
  //   title: '源头单据类型ID',
  //   key: 'firstBillTypeId',
  //   type: JVxeTypes.hidden,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  //   disabled: true
  // },
  // {
  //   title: '源头单据类型名称',
  //   key: 'firstBillTypeName',
  //   type: JVxeTypes.input,
  //   width: "100px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  //   disabled: true
  // },
  {
    title: '备注',
    key: 'remark',
    type: JVxeTypes.normal,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '删除状态', // 0正常 1已删除
    key: 'delFlag',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '创建方式', //0系统生成
    key: 'createMethod',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '第三方编码',
    key: 'thirdPartyCode',
    type: JVxeTypes.hidden,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '组织ID',
    key: 'organizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
  {
    title: '租户ID',
    key: 'tenantId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
    disabled: true
  },
]
export const psPlanOrderOrganizationColumns: JVxeColumn[] = [{
    title: '计划订单ID',
    key: 'planOrderId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '工厂组织ID',
    key: 'factoryOrganizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '工厂组织名称',
    key: 'factoryOrganizationName',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '组织形态',
    key: 'organizationForm',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '营运组织ID',
    key: 'operationOrganizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '营运组织名称',
    key: 'operationOrganizationName',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '净需求货主组织方式',
    key: 'demandOrganizationMethod',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '备注',
    key: 'remark',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '删除状态', // 0正常 1已删除
    key: 'delFlag',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '创建方式', //0系统生成
    key: 'createMethod',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '第三方编码',
    key: 'thirdPartyCode',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '组织ID',
    key: 'organizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '租户ID',
    key: 'tenantId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
]
export const psPlanOrderLogColumns: JVxeColumn[] = [{
    title: '计划订单ID',
    key: 'planOrderId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '日志时间',
    key: 'logTime',
    type: JVxeTypes.datetime,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '备注',
    key: 'remark',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '删除状态', //0正常 1已删除
    key: 'delFlag',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '创建方式', //0系统生成
    key: 'createMethod',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '第三方编码',
    key: 'thirdPartyCode',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '组织ID',
    key: 'organizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '租户ID',
    key: 'tenantId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
]
export const psPlanOrderDeductionColumns: JVxeColumn[] = [{
    title: '计划订单ID',
    key: 'planOrderId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '料品ID',
    key: 'materialId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '料品编号',
    key: 'materialCode',
    type: JVxeTypes.input,
    width: "150px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '料品名称',
    key: 'materialName',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '料品规格',
    key: 'spec',
    type: JVxeTypes.input,
    width: "100px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '单位ID',
    key: 'unitId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '单位名称',
    key: 'unitName',
    width: "100px",
    type: JVxeTypes.input,
    disabled: true
  },
  {
    title: '料品形态属性', // 0制造件 1采购件 2虚拟 3委外件 4费用性料品
    key: 'materialTypeAttribute',
    type: JVxeTypes.inputNumber,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '请购数量',
    key: 'requestPurchaseQuantity',
    type: JVxeTypes.inputNumber,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '采购数量',
    key: 'purchaseQuantity',
    type: JVxeTypes.inputNumber,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '生产数量',
    key: 'productQuantity',
    type: JVxeTypes.inputNumber,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '未检数量',
    key: 'untestedQuantity',
    type: JVxeTypes.inputNumber,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '现存量',
    key: 'currentQuantity',
    type: JVxeTypes.inputNumber,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '合计',
    key: 'total',
    type: JVxeTypes.inputNumber,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  // {
  //   title: '来源单据ID',
  //   key: 'srcBillId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '来源单据编号',
  //   key: 'srcBillCode',
  //   type: JVxeTypes.input,
  //   width: "150px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '来源单据类型ID',
  //   key: 'srcBillTypeId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '来源单据类型名称',
  //   key: 'srcBillTypeName',
  //   type: JVxeTypes.input,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '来源单据明细ID',
  //   key: 'srcBillItemId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  {
    title: '来源行号',
    key: 'orderRowNumber',
    type: JVxeTypes.normal,
    width: "100px",
    defaultValue: '',
  },
  // {
  //   title: '源头单据ID',
  //   key: 'firstBillId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  {
    title: '来源订单号',
    key: 'firstBillCode',
    type: JVxeTypes.normal,
    width: "100px",
  },
  // {
  //   title: '源头单据类型ID',
  //   key: 'firstBillTypeId',
  //   type: JVxeTypes.hidden,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  // {
  //   title: '源头单据类型名称',
  //   key: 'firstBillTypeName',
  //   type: JVxeTypes.input,
  //   width: "200px",
  //   placeholder: '请输入${title}',
  //   defaultValue: '',
  // },
  {
    title: '备注',
    key: 'remark',
    type: JVxeTypes.input,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '删除状态', //0正常 1已删除
    key: 'delFlag',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '创建方式', //0系统生成
    key: 'createMethod',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '第三方编码',
    key: 'thirdPartyCode',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '组织ID',
    key: 'organizationId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '租户ID',
    key: 'tenantId',
    type: JVxeTypes.hidden,
    width: "200px",
    placeholder: '请输入${title}',
    defaultValue: '',
  },
]


// MRP计算结果 行
export const mrpResultColumns = [{
    title: '计划单号',
    dataIndex: 'srcBillCode',
    width: 150
  },
  {
    title: '计划行号',
    dataIndex: 'rowNum',
    width: 100
  },
  {
    title: '版本号',
    dataIndex: 'resultVersion',
    width: 100
  },
  {
    title: '销售订单号',
    dataIndex: 'orderBillCode',
    width: 150
  },
  {
    title: '销售行号',
    dataIndex: 'orderRowNumber',
    width: 120
  },
  {
    title: '物料编码',
    dataIndex: 'materialCode',
    width: 150
  },
   {
    title: '物料名称',
    dataIndex: 'materialName',
    width: 150
  },
   {
    title: '图号',
    dataIndex: 'drawingNo',
    width: 150
  },
   {
    title: '供应类型',
    dataIndex: 'supplyType',
    customRender: ({ text }) =>  text == 0 ? '自制' : text == 1 ? '采购' : text == 2 ? '委外' : '',
    width: 120
  }, {
    title: '订单数量',
    dataIndex: 'orderQuantity',
    width: 120
  }, {
    title: 'MRP数量（毛需求）',
    dataIndex: 'mrpQuantity',
    width: 160
  }, {
    title: '调整后MRP数量（净需求）',
    dataIndex: 'adjustedMrpQuantity',
    width: 170
  }, {
    title: '释放量',
    dataIndex: 'releaseQuantity',
    width: 120
  }, {
    title: '需求日期',
    dataIndex: 'demandDate',
    width: 120
  }, {
    title: '开工日期',
    dataIndex: 'startDate',
    width: 120
  }, {
    title: '需求类型',
    dataIndex: 'demandType',
    customRender: ({ text }) =>  text == 0 ? '独立' : text == 1 ? '相关' : '',
    width: 120
  }, {
    title: '释放状态',
    dataIndex: 'releaseStatus',
    customRender: ({ text }) =>  text == 0 ? '未释放' : text == 1 ? '已释放' : '',
    width: 120
  }, {
    title: '排产方式',
    dataIndex: 'planMethod',
    width: 120
  }, {
    title: '排产单号',
    dataIndex: 'planDocNo',
    width: 140
  },{
    title: '锁定状态',
    dataIndex: 'lockStatus',
    customRender: ({ text }) =>  text == 0 ? '未锁定' : text == 1 ? '已锁定' : '',
    width: 120
  },
];


/**
 * 流程表单调用这个方法获取formSchema
 * @param param
 */
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
